<template>
  <div class="content-wrap">
    <el-descriptions title="" :column="3">
      <el-descriptions-item label="就诊凭证类型">
        <dict-tag
          :options="dict.type.yy_voucher_type"
          :value="info.mdtrtCertType"
      /></el-descriptions-item>
      <el-descriptions-item label="就诊凭证编号">{{
        info.mdtrtCertNo
      }}</el-descriptions-item>
      <el-descriptions-item label="卡识别码">{{
        info.cardSn
      }}</el-descriptions-item>
      <el-descriptions-item label="参保地编号">{{
        info.insuPlcNo
      }}</el-descriptions-item>
      <el-descriptions-item label="就医地编号">{{
        info.mdtrtareaNo
      }}</el-descriptions-item>
      <el-descriptions-item label="定点医疗机构处方编号">{{
        info.hospRxno
      }}</el-descriptions-item>
      <el-descriptions-item label="续方的原处方编号">{{
        info.initRxno
      }}</el-descriptions-item>
      <el-descriptions-item label="开方时间">{{
        info.prscTime
      }}</el-descriptions-item>
      <el-descriptions-item label="药品类目数">{{
        info.rxDrugCnt
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂用法编号">{{
        info.rxUsedWayCodg
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂用法名称">{{
        info.rxUsedWayName
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂频次编号">{{
        info.rxFrquCodg
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂频次名称">{{
        info.rxFrquName
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂剂量单位">{{
        info.rxDosunt
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂单次剂量数">{{
        info.rxDoscnt
      }}</el-descriptions-item>
      <el-descriptions-item label="处方整剂医嘱说明">{{
        info.rxDrordDscr
      }}</el-descriptions-item>
      <el-descriptions-item label="处方有效天数">{{
        info.valiDays
      }}</el-descriptions-item>
      <el-descriptions-item label="处方有效截止时间">{{
        info.valiEndTime
      }}</el-descriptions-item>
      <el-descriptions-item label="复用">{{
        info.reptFlag
      }}</el-descriptions-item>
      <el-descriptions-item label="最大使用次数">{{
        info.maxReptCnt
      }}</el-descriptions-item>
      <el-descriptions-item label="使用最小间隔">{{
        info.minInrvDays
      }}</el-descriptions-item>
    </el-descriptions>
    <el-table 
      :data="medicalRecordDiagnosisList"
      border
      style="width: 100%;margin-top: 30px;"
    >
    <el-table-column label="医疗目录编码" align="center" prop="medListCodg" width="220"/>
      <el-table-column label="院内药品编码" align="center" prop="fixmedinsHilistId" width="120"/>
      <!-- <el-table-column label="医疗机构制剂标志" align="center" prop="hospPrepFlag" width="130">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.hospPrepFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="处方项目分类名称" align="center" prop="rxItemTypeName" width="130"/> -->
      
      <el-table-column label="药品名" align="center" prop="drugGenname" width="120"/>
      <el-table-column label="药品剂型" align="center" prop="drugDosform" />
      <el-table-column label=" 药品规格" align="center" prop="drugSpec" width="120"/>
      <el-table-column label="药品商品名" align="center" prop="drugProdname" width="120"/>
      <el-table-column label="生厂厂家" align="center" prop="prdrName" />
      <el-table-column label="用药途径描述" align="center" prop="medcWayDscr" width="120"/>
      <el-table-column label="用药开始时间" align="center" prop="medcBegntime" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.medcBegntime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="用药结束时间" align="center" prop="medcEndtime" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.medcEndtime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label=" 用药天数" align="center" prop="medcDays" />
      <el-table-column label="单次剂量单位" align="center" prop="sinDosunt" width="120"/>
      <el-table-column label="单次用量" align="center" prop="sinDoscnt" />
      <el-table-column label="使用频次名称" align="center" prop="usedFrquName" width="120"/>
      <el-table-column label="药品总用药量单位" align="center" prop="drugDosunt" width="130"/>
      <el-table-column label="药品总用药量" align="center" prop="drugCnt"width="120" />
      <el-table-column label="药品单价" align="center" prop="drugPric" />
      <el-table-column label="药品总金额" align="center" prop="drugSumamt" width="120"/>
      <el-table-column label="中药类别名称" align="center" prop="tcmdrugTypeName" width="130"/>
      <el-table-column label="草药脚注" align="center" prop="tcmherbFoote" />
      <el-table-column label="药物类型" align="center" prop="mednTypeName" width="120"/>
      <el-table-column label="主要用药标志" align="center" prop="mainMedcFlag" width="130">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.mainMedcFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="加急标志" align="center" prop="urgtFlag">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.urgtFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="基本药物标志" align="center" prop="basMednFlag" width="130">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.basMednFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="是否进口药品" align="center" prop="impDrugFlag"width="130">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.impDrugFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="是否OTC药品" align="center" prop="otcFlag" width="130">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yy_status_type" :value="scope.row.otcFlag"/>
        </template>
      </el-table-column>
      <el-table-column label="医院审批标志" align="center" prop="hospApprFlag" width="120"/>
      <el-table-column label="自费原因描述" align="center" prop="realDscr" width="120"/>
    </el-table>
  </div>
</template>

<script>
import { getListPre, listPreDetail } from "@/api/hl/rx";
export default {
  props: ["id"],
  dicts: ["yy_voucher_type","yy_status_type"],
  data() {
    return {
      // 假设有初始数据
      medicalRecordDiagnosisList: [],
      info: null, //处方信息
    };
  },
  created() {
    this.getDetail(); // 处方信息
    this.getList(); // 处方明细
  },
  methods: {
    // 处方明细
    getList() {
      listPreDetail({ id: this.id }).then((response) => {
        this.medicalRecordDiagnosisList = response.data;
      });
    },
    // 处方信息
    getDetail() {
      getListPre({ id: this.id }).then((response) => {
        this.info = response.data;
      });
    },
  },
};
</script>
<style scoped lang="scss">
.content-wrap {
  padding: 32px 0 32px 0;
}
</style>
